package com.ucs.ui;

import com.ucs.util.UCSData;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ListView;

public class SelectGuestsActivity extends ListActivity{
	public static final String NUMBER_OF_GUESTS="NUMBER_OF_GUESTS";
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setListAdapter(UCSData.getInstance().getGuestsAdapter(this));
	}
	
	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		Bundle bundle = new Bundle();
		bundle.putInt(NUMBER_OF_GUESTS, position+1);
		Intent intent = new Intent();
		intent.putExtras(bundle);
		setResult(RESULT_OK, intent);
		finish();		
	}
	
}
